﻿using HAF.LogUtility;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace FileLock
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string tmpPath = txtRundir.Text;//Path.Combine(AppDomain.CurrentDomain.BaseDirectory, )  "D:\\Temp\\"
            if (Directory.Exists(tmpPath))
            {
                List<string> fileList = Directory.EnumerateFiles(tmpPath, "*.*", SearchOption.AllDirectories).ToList<string>();
                if (fileList.Count > 0)
                {
                    foreach (var item in fileList)
                    {
                        LogHelper.WriteDebugLog(item);
                    }
                    
                }
            }
            else
            {
                LogHelper.WriteErrorLog("目录{0}不存在", tmpPath);
            }
            
        }
    }
}
